/*
day198
2020.3.13
*/ 
#include<vector>
#include<cstdlib>
using namespace std;


class MinStack {
	vector<int> vec;
	int min;
public:
    /** initialize your data structure here. */
    MinStack() {
		min=INT_MAX;
    }
    
    void push(int x) {
		vec.push_back(x);
		if(x<min)
		{
			min=x;
		}
    }
    
    void pop() {
		if(vec.size()==0)
		{
			return ;
		}
		int tem=vec.back();
		vec.pop_back();
		
		if(tem==min)
		{
			min=INT_MAX;
			for(auto &i:vec)
			{
				if(min>i)
				{
					min=i;
				}
			} 
		}
		
    }
    
    int top() {
		return vec.back();
    }
    
    int getMin() {
		return min;
    }
};




int main()
{
	return 0;
}
